package com.wicket.okrcomponent.web.contorller;

import cn.hutool.core.bean.BeanUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.page.PageMethod;
import com.wicket.okrcomponent.biz.service.TargetCalcService;
import com.wicket.okrcomponent.biz.service.dto.req.*;
import com.wicket.okrcomponent.biz.service.dto.res.*;
import com.wicket.okrcomponent.common.ro.OkrResult;
import com.wicket.okrcomponent.common.util.CommonFunctionHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@RestController
@RequestMapping("/comp/targetCalc/")
public class TargetCalcController {

  @Autowired
  TargetCalcService targetCalcService;
/**
   * D2查询目标标准数据列表(redis)
   */
    @PostMapping("queryTargetStandardDataListCom")
    public OkrResult<QueryTargetStandardDataListComRespDto> queryTargetStandardDataListCom(@RequestBody @Validated QueryTargetStandardDataListComReqDto reqDTO){
    return OkrResult.success(targetCalcService.queryTargetStandardDataListCom(reqDTO));
    }
/**
   * D2新增目标标准数据(redis)
   */
    @PostMapping("addTargetStandardDataCom")
    public OkrResult<AddTargetStandardDataComRespDto> addTargetStandardDataCom(@RequestBody @Validated AddTargetStandardDataComReqDto reqDTO){
    return OkrResult.success(targetCalcService.addTargetStandardDataCom(reqDTO));
    }
/**
   * D2准备刷OKR树目标归属周期配置(公共)
   */
    @PostMapping("preparationBrushOkrTreeTargetAttributionCycleConfCom")
    public OkrResult<PreparationBrushOkrTreeTargetAttributionCycleConfComRespDto> preparationBrushOkrTreeTargetAttributionCycleConfCom(@RequestBody @Validated PreparationBrushOkrTreeTargetAttributionCycleConfComReqDto reqDTO){
    return OkrResult.success(targetCalcService.preparationBrushOkrTreeTargetAttributionCycleConfCom(reqDTO));
    }
/**
   * D2获取成果等级转量化得分(公共)
   */
    @PostMapping("obtainQuantitativeScoreForAchievementLevelCalcCom")
    public OkrResult<ObtainQuantitativeScoreForAchievementLevelCalcComRespDto> obtainQuantitativeScoreForAchievementLevelCalcCom(@RequestBody @Validated ObtainQuantitativeScoreForAchievementLevelCalcComReqDto reqDTO){
    return OkrResult.success(targetCalcService.obtainQuantitativeScoreForAchievementLevelCalcCom(reqDTO));
    }
/**
   * D2执行数值上不封顶判断(公共)
   */
    @PostMapping("implementNonCappedNumJudgeCom")
    public OkrResult<ImplementNonCappedNumJudgeComRespDto> implementNonCappedNumJudgeCom(@RequestBody @Validated ImplementNonCappedNumJudgeComReqDto reqDTO){
    return OkrResult.success(targetCalcService.implementNonCappedNumJudgeCom(reqDTO));
    }
/**
   * D2准备目标完成数与完成率计算配置(公共)
   */
    @PostMapping("implementPrepareTargetReachedCalcConfCom")
    public OkrResult<ImplementPrepareTargetReachedCalcConfComRespDto> implementPrepareTargetReachedCalcConfCom(@RequestBody @Validated ImplementPrepareTargetReachedCalcConfComReqDto reqDTO){
    return OkrResult.success(targetCalcService.implementPrepareTargetReachedCalcConfCom(reqDTO));
    }
///**
//   * D2准备刷OKR树目标归属周期配置(公共)
//   */
//    @PostMapping("preparationBrushOkrTreeTargetAttributionCycleConfCom")
//    public OkrResult<PreparationBrushOkrTreeTargetAttributionCycleConfComRespDto> preparationBrushOkrTreeTargetAttributionCycleConfCom(@RequestBody @Validated PreparationBrushOkrTreeTargetAttributionCycleConfComReqDto reqDTO){
//    return OkrResult.success(targetCalcService.preparationBrushOkrTreeTargetAttributionCycleConfCom(reqDTO));
//    }
}
